{{assign var="title" value="项目列表"}}
{{include file="admin/intop.html"}}
<script type="text/javascript">
function add(){    
    window.location.href = "admin.php?ctl=deal&t={{$smarty.request.t}}&act=add";
}
function dealload(id){
    window.location.href = "admin.php?ctl=deal&act=dealload&pid="+id;
}
function dealload_add(id){
    window.location.href = "admin.php?ctl=deal&act=dealload_add&pid="+id;
}
function edit(id){    
    window.location.href = "admin.php?ctl=deal&act=edit&id="+id;
}
function del(id){    
    window.location.href = "admin.php?ctl=deal&act=del&id="+id;
}
</script>
<div class="toolsBar">
     <input type="button" value="添加{{if $type == 'j'}}借款{{else}}理财{{/if}}产品" onclick="add()" class="button_style">
</div>
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="table_list">
	<tr>
		<th>ID</th>
		<th>{{if $type == 'j'}}借款{{else}}理财{{/if}}产品</th>
                <th>{{if $type == 'j'}}借款总额{{else}}融资总额{{/if}}</th>
                {{if $type == 'j'}}
                <th>批准总额</th>
                {{else}}
                <th>单笔最大额</th>
                {{/if}}                
                <th>{{if $type == 'j'}}借款期限{{else}}投资期限{{/if}}</th>	
		<th>{{if $type == 'j'}}年利率{{else}}年化收益率{{/if}}</th>		
		<th>{{if $type == 'j'}}还款方式{{else}}收益方式{{/if}}</th>                
                <th>{{if $type == 'j'}}借款状态{{else}}理财状态{{/if}}</th>
                <th>创建时间</th>
		<th>操作</th>
	</tr>
	{{foreach from=$res.data item=item}}
	<tr>
		<td>{{$item.ID}}</td>
		<td>{{$item.TITLE}}</td>
                <td>{{$item.PRICE}} 元</td>
                {{if $type == 'j'}}
                <td>{{$item.PRICE_ALLOW}} 元</td>
                {{else}}
                <td>{{$item.MAX_LOAD}} 元</td>
                {{/if}}     
                <td>{{$item.REPAY_TIME}} 个月</td>
		<td>{{$item.RATE}} %</td>		
		<td>{{$type_loan[$item.TYPE_LOAN]}}</td>		
                <td>{{$deal_stat[$item.DEAL_STAT]}}</td>
                <td>{{$item.CREATE_TIME|date_format:"%Y-%m-%d"}}</td>
		<td>
                    {{if $type == 'l'}}
                    <a id="GridView1_ctl02_hlkEdit" onclick="javascript:dealload({{$item.ID}});">投资记录</a>
                    | <a id="GridView1_ctl02_hlkEdit" onclick="javascript:dealload_add({{$item.ID}});">投资</a>
                    | 
                    {{/if}}
                    <a id="GridView1_ctl02_hlkEdit" onclick="javascript:edit({{$item.ID}});">修改</a>
                    | <a id="GridView1_ctl02_hlkDel" href="javascript:del({{$item.ID}});">删除</a>
		</td>
	</tr>
	{{/foreach}}
	{{if $res.count}}
		<tr class="bottom"><td colspan="10" class="page">{{$res.page}}</td></tr>
	{{else}}
		<tr><td colspan="10">没有数据记录</td></tr>
	{{/if}}
</table>
{{include file="admin/infoot.html"}}